﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PocketLibrary;
using PocketLibrary.Storage;

namespace PocketApplicationsMVC.Views
{
    public interface IBoxNetView : IView
    {
        void LoggedIn(bool success);
        void UpdateStatus(string text);
        void NotifyStatus(string caption, string text, bool critical);
        void UpdateFolderContents(List<BoxNetAPITreeItem> contents);
        void UpdateFileProgress(int value);

        string FileToUpload { get; }

        /// <summary>
        /// Downloads a file from Box.Net account
        /// </summary>
        /// <param name="source">Box.Net file id</param>
        /// <param name="target">Local file path</param>
        //void DownloadFile(string source, string target);

        /// <summary>
        /// Uploads a file to Box.Net account
        /// </summary>
        /// <param name="source">Local file path</param>
        //void UploadFile(string source);

        event EventHandler<BoxNetDownloadArgs> DownloadFile;
        event EventHandler UploadFile;
        event EventHandler<BoxNetUserArgs> OnUserLogin;
        event EventHandler<BoxNetFileArgs> ListFolder;
        event EventHandler ListParentFolder;
        event EventHandler ShowMenuForm;
        event EventHandler UpdateFolder;

    }

    #region eventargument classes
    public class BoxNetFileArgs : EventArgs
    {
        /// <summary>
        /// Box.Net file or folder id
        /// </summary>
        public string FileId { get; set; }

        public BoxNetFileArgs(string fileid)
        {
            this.FileId = fileid;
        }
    }

    public class BoxNetDownloadArgs : EventArgs
    {
        public string Target { get; set; }
        public string FileId { get; set; }

        public BoxNetDownloadArgs(string fileid, string target)
        {
            this.FileId = fileid;
            this.Target = target;
        }
    }

    public class BoxNetFileUploadArgs : EventArgs
    {
        public string FileName { get; set; }

        public BoxNetFileUploadArgs(string filename)
        {
            this.FileName = filename;
        }
    }

    public class BoxNetUserArgs : EventArgs
    {
        public string Username { get; set; }
        public string Password { get; set; }

        public BoxNetUserArgs(string username, string password)
        {
            this.Username = username;
            this.Password = password;
        }
    } 
    #endregion
}
